package com.lemzdo.community.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class HelloController {
    @RequestMapping(value = "/hello")
    //@RequestParam接受url中携带的参数 name="value"
    public String hello(@RequestParam(name = "name")String name,
                        @RequestParam(name="age") int age, Model model){
        model.addAttribute("name",name);
        model.addAttribute("age",age);
        return "hello";
    }

}
